function array2list(a, order=false){
    /*
    inefficient version
    a: Array -- array of strings
     */
    l = document.createElement('ol')
    const tag = order?'ol':'ul'
    for (t in a) {
        i = d.createElement('li')
        i.append(t);
        l.appendChild(i)
    }
    return l
}

function array2items(a){
    /*
    transform an array to a list of items
    a: Array -- array of strings
    */
    f = document.createDocumentFragment()

    a.forEach( t=>{
        i = document.createElement('li')
        i.append(t);
        f.appendChild(i)}
    )
    return f
}

function array2list(a, order=false){
    /*
    transform an array to a list of items with tag ol or ul
    */
    f = array2items(a)
    const tag = order?'ol':'ul'
    l = document.createElement(tag)
    l.appendChild(f)
    return l
}

function add_list(a, order=false){
    /*add a list to the document*/
    b = document.body
    l = array2list(a, order)
    b.appendChild(l)
}

function append_list(a, b=document.body, order=false){
    /*add a list to the document*/
    l = array2list(a, order)
    b.appendChild(l)
}